<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
		<meta charset="utf-8">
		<title>淘天机站群系统管理后台</title>
		<!-- include header_meta -->
</head>

<body>
	<!-- include header -->
	<div class="cp-wrap {if $jnarrow}jnarrow{/if}">
		<div class="crumb"></div>
		<div class="cp-table-top cl">
			<div class="fl">
				<a class="btn" onclick="window.location.href='?m=article&a=add'"><span class="fa fa-plus fa-fw"></span>添加文章</a>
			</div>
			<div class="fr">
				<form method="get">
					<input type="hidden" name="m" value="article">
					<input type="hidden" name="a" value="index">
					<input name="stitle" value="{$stitle}" type="text" placeholder="请输入您要搜索的标题">
					<input type="submit" value="搜索" class="btn" />
				</form>
			</div>
		</div>
		<form method="post" name="alldel_form" onsubmit="return del_all();" action="?m=article&a=del">
			<div class="cp-table">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tbody>
						<tr>
							<th width="90" align="left">ID</th>
							<th align="left">标题</th>
							<th align="left">所在站点</th>
							<th align="left">所属栏目</th>
							<th align="left">发布时间</th>
							<th align="left">状态</th>
							<!-- if $conf['baidu_tui_token'] -->
							<th align="left">推送状态</th>
							<!-- /if -->
							<th width="100" align="center">操作</th>
						</tr>
						<!-- foreach $list -->
						<tr>
							<td align="left">
								<input type="checkbox" name="id[]" class="table-main" value="{$id}">&nbsp;&nbsp;{$id}</td>
							<td align="left">
								<a href="{$url}" class="unpjax" target="_blank">
									{cut($title,50)}
									<!-- if $thumb-->
									[<font color="red" size="-2">图</font>]
									<!-- /if -->
									<!-- if $flag=='h' -->
									[<font color="red" size="-2">头条</font>]
									<!-- elseif $flag=='c' -->
									[<font color="red" size="-2">推荐</font>]
									<!-- elseif $flag=='f' -->
									[<font color="red" size="-2">幻灯片</font>]
									<!-- elseif $flag=='a' -->
									[<font color="red" size="-2">特荐</font>]
									<!-- elseif $flag=='s' -->
									[<font color="red" size="-2">滚动</font>]
									<!-- elseif $flag=='b' -->
									[<font color="red" size="-2">加粗</font>]
									<!-- /if -->
								</a>
							</td>
							<td align="left">{if isset($allyuming[$yuming_id])}{$allyuming[$yuming_id]['name']}{/if}</td>
							<td align="left">{$classname}</td>
							<td align="left">{date("Y-m-d H:i", $addtime)}</td>
							<td align="left">{if $status}已发布{else}
								<font color=red>待审核</font>{/if}</td>
							<!-- if $conf['baidu_tui_token'] -->
							<td align="left">
								{if $ping_status==0} 未推送 {elseif $ping_status==1} 已推送 {elseif $ping_status==-1} {if $ping_errMsg=='102'} token错误 {elseif $ping_errMsg=='101'} 百度接口异常 {elseif $ping_errMsg=='103'} not_same_site {elseif $ping_errMsg=='104'} not_valid {elseif $ping_errMsg=='100'} 未授权 {else} 错误代码:{$ping_errMsg} {/if} {else} 推送失败 {/if}
							</td>
							<!-- /if -->
							<td align="center">
								<a href="?m=article&a=edit&id={$id}" class="action_button fa fa-edit fa-fw" title="修改"></a>
								<a href="?m=article&a=del&id={$id}" onclick="return confirm('确定删除吗?')" class="action_button fa fa-trash-o fa-fw" title="删除"></a>
							</td>
						</tr>
						<!-- /foreach -->
					</tbody>
				</table>
			</div>
			<div id="msg" style="padding-left:20px;color:red;"></div>
			<div class="cp-table-top">
				<label>
					<input type="checkbox" id="all" onclick="check_all()" />全选</label>&nbsp;
				<input type="submit" class="btn" value="批量删除">
			</div>
		</form>
		<!-- if empty($list) -->
		<div class="noresult">暂时没有可显示数据</div>
		<!-- /if -->
		<div class="cp-pages">
			{$page}
		</div>
	</div>
	<!-- include footer -->
	<script type="text/javascript">
		function del_all() {
			var ids = document.getElementsByName("id[]");
			var flag = false;
			for (var i = 0; i < ids.length; i++) {
				if (ids[i].checked) {
					flag = true;
					break;
				}
			}
			if (!flag) {
				$("#msg").text("请最少选择一项！");
				return false;
			}
			return confirm('确定批量删除吗？');
		}

		function check_all() {
			var ids = document.getElementById("all");
			if (ids.checked) {
				$(".table-main").each(function() {
					$(this).prop("checked", true);
				})
			} else {
				$(".table-main").each(function() {
					$(this).prop("checked", false);
				})
			}

		}
	</script>
</body>

</html>
